@extends('admin/layout/main')

@section('content')
    <a href="{{ url('admin/admin/index') }}" class="btn btn-primary" style="float:right;margin-bottom:20px">返回</a>

    <form class="form-horizontal" style="clear:both" action="{{ url('admin/admin/store') }}" method="post">
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">管理员姓名</label>
            <div class="col-sm-10">
                <input type="text" name="name" class="form-control" id="inputEmail3" placeholder="姓名" value="{{ old('name') }}">
                <p class="help-block" style="color:red;">{{ $errors->first('name') }}</p>
            </div>
        </div>

        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">管理员密码</label>
            <div class="col-sm-10">
                <input type="password" name="password" class="form-control" id="inputPassword3" placeholder="密码">
                <p class="help-block" style="color:red;">{{ $errors->first('password') }}</p>
            </div>
        </div>

        <div class="form-group">
            <label for="inputPassword4" class="col-sm-2 control-label">确认密码</label>
            <div class="col-sm-10">
                <input type="password" name="notpass" class="form-control" id="inputPassword4" placeholder="确认密码">
                <p class="help-block" style="color:red;">{{ $errors->first('notpass') }}</p>
            </div>
        </div>

        <div class="form-group">
            <label for="inputPassword4" class="col-sm-2 control-label">权限选择</label>
            <div class="col-sm-10">
                <a class="btn btn-primary" id="open_select_box">展开选择</a>
                <input type="text" name="roles" value="" class="form-control" style="display:none"/>
            </div>
        </div>

        <div class="form-group">
            <label for="inputPassword5" class="col-sm-2 control-label">电子邮箱</label>
            <div class="col-sm-10">
                <input type="email" name="email" class="form-control" id="inputPassword5" placeholder="电子邮箱" {{ old('email') }}>
                <p class="help-block" style="color:red;">{{ $errors->first('email') }}</p>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">确认</button>
            </div>
        </div>
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
    </form>
@endsection

@section('script')
    <script src="{{ asset('js/layer/layer.js') }}"></script>
    <script>
        $('#open_select_box').click(function() {
            layer.open({
                type: 2,
                title: '选择权限',
                shadeClose: true,
                shade: 0.8,
                area: ['600px', '600px'],
                content: "{{ url('admin/admin/select_power') }}",
            });
            return false;
        });
    </script>
@endsection
